{include file="admin/goods/style" /}
<form class="layui-form" action="" method="post" name="myform" id="myform">
	<input type="hidden" name="__token__" value="{$Request.token}" />
	<div class="manniucms-sub-content" id="goods-add-page">
		<div class="row">
			<div class="col-md-9">
				<div class="layui-box">
					<fieldset class="layui-elem-field">
						<legend>商品添加</legend>
						<div class="layui-field-box">
							<div class="layui-form-item">
								<label class="layui-form-label color_read">选择分类</label>
								<div class="layui-input-block">
									<select name="catid" lay-verify="required">
										<option value="">请选择栏目</option>
										{$categorys}
									</select>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline" style="width: 50%;margin-right: 0px;">
									<label class="layui-form-label color_read">商品名称</label>
									<div class="layui-input-block">
										<input type="text" name="goods_name" id="mn_goods_name" required  lay-verify="required" placeholder="商品名称" class="layui-input">
									</div>
								</div><div class="layui-inline" style="width: 50%;margin-right: 0px;">
									<label class="layui-form-label">商品编号</label>
									<div class="layui-input-block">
										<input type="text" name="goods_sn" id="mn_goods_sn" placeholder="不填写则系统自动生成" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline" style="width: 50%;margin-right: 0px;">
									<label class="layui-form-label color_read">店铺价格</label>
									<div class="layui-input-block">
										<input type="text" name="shop_price" id="mn_shop_price" required  lay-verify="required" placeholder="￥" class="layui-input shop_price">
									</div>
								</div><div class="layui-inline" style="width: 50%;margin-right: 0px;">
									<label class="layui-form-label color_read">市场价</label>
									<div class="layui-input-block">
										<input type="text" name="market_price" id="mn_market_price" required  lay-verify="required" placeholder="￥" class="layui-input">
									</div>
								</div>
							</div>
							{if isset($mall_goods_specs) && !empty($mall_goods_specs)}
							<div class="layui-form-item goods_specs_show">
								<label class="layui-form-label">规格分类</label>
								<div class="layui-input-block">
									<div class="layui-tab layui-tab-brief" lay-filter="goods_spec_tab">
										<ul class="layui-tab-title">
											{volist name="mall_goods_specs" id="cat"}
											<li>{$cat.name}</li>
											{/volist}
										</ul>
										<div class="layui-tab-content">
											{volist name="mall_goods_specs" id="cat"}
											<div class="layui-tab-item">
												<div class="container-fluid">
													{if isset($cat.groups) && !empty($cat.groups)}
														{volist name="$cat.groups" id="group"}
															{if isset($group.items) && !empty($group.items)}
															<div class="row goods_spec_itembox">
																<div class="col-md-1">{$group.name}：</div>
																<div class="col-md-11">
																	<div class="row">
																		{volist name="$group.items" id="item"}
																		<div class="col-xs-12 col-sm-4 col-md-3">
																			<input type="checkbox" name="goods_spec[{$cat.id}][{$item.id}]" value="{$item.id}" title="{$item.name}" lay-filter="goods_spec_checkbox">
																			<input type="text" name="goods_spec[{$cat.id}][{$item.id}][markup]" placeholder="￥加价" autocomplete="off" class="layui-input markup_input" disabled="disabled">
																		</div>
																		{/volist}
																	</div>
																</div>
															</div>
															{/if}
														{/volist}
													{/if}
												</div>
											</div>
											{/volist}
										</div>
									</div>
									<div class="layui-form-mid">勾选规格代表启用，规格右侧输入加价金额，代表在【店铺价格】基础上加价，不同规格金额叠加计算<br />如：店铺价格为3000，规格颜色为绿色加价0，规格等级为特等加价1000，那么总价为3000+0+1000=4000</div>
								</div>
							</div>
							{/if}
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label color_read">商品简介</label>
								<div class="layui-input-block">
									<textarea name="goods_brief" id="mn_goods_brief" required lay-verify="required" placeholder="商品简介" class="layui-textarea" style=""></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label color_read">SEO关键字</label>
								<div class="layui-input-block">
									<input type="text" name="goods_keywords" id="mn_goods_keywords" required  lay-verify="required" placeholder="SEO关键字" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-inline" style="width: 33.33%;margin-right: 0px;">
									<label class="layui-form-label color_read">商品库存</label>
									<div class="layui-input-block">
										<input type="text" name="goods_stock" id="mn_goods_stock" required  lay-verify="required|number" placeholder="商品库存" class="layui-input">
									</div>
								</div><div class="layui-inline" style="width: 33.33%;margin-right: 0px;">
									<label class="layui-form-label color_read">预警库存</label>
									<div class="layui-input-block">
										<input type="text" name="warn_stock" id="mn_warn_stock" required  lay-verify="required|number" placeholder="预警库存" class="layui-input">
									</div>
								</div><div class="layui-inline" style="width: 33.33%;margin-right: 0px;">
									<label class="layui-form-label">销售量</label>
									<div class="layui-input-block">
										<input type="text" name="sale_count" id="mn_sale_count" value="0" required lay-verify="required" placeholder="销售量" class="layui-input layui-disabled" disabled>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">商品图片</label>
								<div class="layui-input-block">
									<div class="goods-img">
										<div class="item">
											<img src="__PUBLIC__images/default_cover.jpg" id="field_goods_img_1_path" onclick="mn_upload_files('goods_img_1',1)">
											<input type="text" name="goods_img[1]" id="field_goods_img_1_url" class="mn_hide">
											<i class="layui-icon" onclick="mn_del_thumb('goods_img_1','__PUBLIC__images/default_cover.jpg')">&#x1007;</i>
										</div>
										<div class="item">
											<img src="__PUBLIC__images/default_cover.jpg" id="field_goods_img_2_path" onclick="mn_upload_files('goods_img_2',1)">
											<input type="text" name="goods_img[2]" id="field_goods_img_2_url" class="mn_hide">
											<i class="layui-icon" onclick="mn_del_thumb('goods_img_2','__PUBLIC__images/default_cover.jpg')">&#x1007;</i>
										</div>
										<div class="item">
											<img src="__PUBLIC__images/default_cover.jpg" id="field_goods_img_3_path" onclick="mn_upload_files('goods_img_3',1)">
											<input type="text" name="goods_img[3]" id="field_goods_img_3_url" class="mn_hide">
											<i class="layui-icon" onclick="mn_del_thumb('goods_img_3','__PUBLIC__images/default_cover.jpg')">&#x1007;</i>
										</div>
										<div class="item">
											<img src="__PUBLIC__images/default_cover.jpg" id="field_goods_img_4_path" onclick="mn_upload_files('goods_img_4',1)">
											<input type="text" name="goods_img[4]" id="field_goods_img_4_url" class="mn_hide">
											<i class="layui-icon" onclick="mn_del_thumb('goods_img_4','__PUBLIC__images/default_cover.jpg')">&#x1007;</i>
										</div>
										<div class="item">
											<img src="__PUBLIC__images/default_cover.jpg" id="field_goods_img_5_path" onclick="mn_upload_files('goods_img_5',1)">
											<input type="text" name="goods_img[5]" id="field_goods_img_5_url" class="mn_hide">
											<i class="layui-icon" onclick="mn_del_thumb('goods_img_5','__PUBLIC__images/default_cover.jpg')">&#x1007;</i>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label color_read">商品描述</label>
								<div class="layui-input-block">
									<!-- 配置文件 -->
								    <script type="text/javascript" src="__PUBLIC__js/ueditor/ueditor.config.js"></script>
								    <!-- 编辑器源码文件 -->
								    <script type="text/javascript" src="__PUBLIC__js/ueditor/ueditor.all.js"></script>
									<!-- 编辑器语言 -->
								    <script type="text/javascript" src="__PUBLIC__js/ueditor/lang/zh-cn/zh-cn.js"></script>
						        	<textarea id="mn_content" name="goods_desc"></textarea>
						        	<script type="text/javascript">
										var editorOption = {
											UEDITOR_HOME_URL: "__PUBLIC__js/ueditor/",
											UEDITOR_URL: "__PUBLIC__js/ueditor/",
											//serverUrl:"",
											lang: "zh-cn",
											initialContent:"",
											initialFrameWidth: "100%",
											initialFrameHeight: "400",
											initialStyle:"body{font-size:14px}",
											wordCount:false,
											elementPathEnabled:false,
											autoFloatEnabled:false,
											autoHeightEnabled:false,
											charset:"utf-8",
											zIndex:"1",
											pageBreakTag:"_page_break_tag_"
										};
										var editor = new baidu.editor.ui.Editor(editorOption);
										editor.render(mn_content);
									</script>
								</div>
							</div>
						</div>
					</fieldset>
				</div>
			</div>
			<div class="col-md-3 msc-form-side">
				<div class="layui-box">
					<fieldset class="layui-elem-field">
						<legend>基本</legend>
						<div class="layui-field-box">
							<div class="layui-form-item">
								<fieldset class="layui-elem-field layui-field-title">
									<legend><span class="color_read">商品缩略图</span></legend>
								</fieldset>
								<div class="layui-input-block mb10">
									<div class="goods-thumb text-center">
										<img src="__PUBLIC__images/default_cover.jpg" id="field_goods_thumb_path">
									</div>
								</div>
								<div class="layui-input-block">
									<input type="text" name="goods_thumb" id="field_goods_thumb_url" required  lay-verify="required" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-input-block">
									<div class="text-center">
										<button type="button" class="layui-btn" onclick="mn_upload_files('goods_thumb',1)"><i class="layui-icon">&#xe64a;</i> 上传缩略图</button>
										<button type="button" class="layui-btn layui-btn-danger" onclick="mn_del_thumb('goods_thumb','__PUBLIC__images/default_cover.jpg')"><i class="layui-icon">&#xe640;</i> 删除缩略图</button>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<fieldset class="layui-elem-field layui-field-title">
									<legend><span class="color_read">是否上架</span></legend>
								</fieldset>
								<div class="layui-input-block">
									<input type="radio" name="is_sale" value="1" title="上架" checked>
									<input type="radio" name="is_sale" value="0" title="不上架">
								</div>
							</div>
							<div class="layui-form-item">
								<fieldset class="layui-elem-field layui-field-title">
									<legend><span class="color_read">销售状态</span></legend>
								</fieldset>
								<div class="layui-input-block">
									<input type="radio" name="status" value="1" title="正常" checked>
									<input type="radio" name="status" value="0" title="禁售">
								</div>
							</div>
						</div>
					</fieldset>
				</div>
			</div>
		</div>
	</div>
	<!-- 底部 -->
	<div class="manniucms-sub-footer">
		<div class="layui-box msf-box text-center">
			<div class="layui-inline">
				<button class="layui-btn" lay-submit><i class="layui-icon">&#xe60a;</i> 保存</button>
				<button type="button" class="layui-btn layui-btn-primary goback"><i class="layui-icon">&#xe603;</i> 返回</button>
			</div>
		</div>
	</div>
</form>